package io.libp2p.example.chat;

import java.util.UUID;

public class SpdJson {
    public static String deviceId;

    public static final String TYPE_START = "startConnect";
    public static final String TYPE_OFFER = "offer";
    public static final String TYPE_ANSWER = "answer";
    public static final String TYPE_CANDI = "iceCandidate";
    public static final String TYPE_REMOVE_ICE = "removeIce";
    public static final String TYPE_START_P2P = "startP2P";

    static {
        deviceId = UUID.randomUUID().toString().split("-")[0].toUpperCase();
    }

    public String type;

    public String sdp;
    public int sdpMLineIndex;
    public String sdpMid;

    public String peerId;
    public String destId;

    public String msgId = UUID.randomUUID().toString();

    public SpdJson(String type, String destId) {
        this.type = type;
        this.peerId = deviceId;
        this.destId = destId;
    }

}
